#ifndef BASEALG_CONCRESORT_H_
#define BASEALG_CONCRESORT_H_
#include "Xsort.h"
#include "SelectSort.h"
#include "QuickSort.h"

enum SORTKIND {SELECTS, QUICKS};

class ConcreSort
{
public:
	ConcreSort(enum SORTKIND sortkind)
	{
		if (SELECTS == sortkind) 
		{
			m_xsort = new SelectSort();
		}
		else if (QUICKS == sortkind) 
		{
			m_xsort = new QuickSort();
		}
		else
		{
			m_xsort = NULL;
		}	
	}
	
	virtual ~ConcreSort()
	{
		delete m_xsort;
	}
	void mysort(int a[], int l, int r)
	{
		m_xsort->mySort(a, l, r);
	}
protected:
private:
	Xsort *m_xsort;
};

#endif